package com.eling.elcms.travel.model;

import com.eling.elcms.core.dao.annotation.Between;
import com.eling.elcms.core.dao.annotation.CriteriaEnhancer;
import com.eling.elcms.core.dao.annotation.CriteriaEnhancers;
import com.eling.elcms.core.dao.hibernate.OrderCriteriaEnhancer;
import com.eling.elcms.core.dao.hibernate.search.EnumBridge;
import com.eling.elcms.core.model.BaseModel;
import com.eling.elcms.system.model.CommonUser;
import com.eling.elcms.travel.model.CheckInImplement.CheckStatus;
import org.hibernate.search.annotations.*;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "travel_checkinmeeting")
@Indexed
@CriteriaEnhancers(criteriaEnhancers = {
		@CriteriaEnhancer(impl = OrderCriteriaEnhancer.class) })
public class CheckInMeeting extends BaseModel {

	private static final long serialVersionUID = 6608662465552662126L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@DocumentId
	private Long pkCheckInMeeting;
	
	/** 入住准备落实 */
	@ManyToOne(fetch = FetchType.LAZY)//, mappedBy = "checkInCar")
	@JoinColumn(name = "pkCIImplement")
	@IndexedEmbedded(depth = 1)
	private CheckInImplement checkInImplement;
	
	
	/** 是否会议 */
	@Column
	private Boolean haveMeeting;	
	
	/** 会议时间 */
	@Column
	@Between
	private Date meetingDate;
	
	/** 场次 */
	@Column
	private String screenings;
	
	/** 会议室 */
	@Column
	private String meetingRoom;
	
	/** 参会人数 */
	@Column
	private Integer peoCount;
	
	/** 会议台型 */
	@Column
	private String meetPlaceType;
	
	/** 例牌横幅内容 */
	@Column(length=255)
	private String content;
	
	/** 前厅LED */
	@Column(length=255)
	private String contentLED;
	
	/** 水牌 */
	@Column(length=255)
	private String license;	
	
	/** 备注 */
    @Column(length = 1023)
    @Field
	private String description;	
	
	/** 处理人 */
    @ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "operator")
	@IndexedEmbedded(depth = 1)
	private CommonUser operator;
	
	/** 处理时间 */
    @Column
	private Date operateDate;   
    
    /** 状态	无要求，待落实，已落实 */
    @Enumerated(EnumType.STRING)
    @Field
    @FieldBridge(impl = EnumBridge.class)
    private CheckStatus status;
	
	@Version
	private Integer version;

	public Long getPkCheckInMeeting() {
		return pkCheckInMeeting;
	}

	public void setPkCheckInMeeting(Long pkCheckInMeeting) {
		this.pkCheckInMeeting = pkCheckInMeeting;
	}

	public CheckInImplement getCheckInImplement() {
		return checkInImplement;
	}

	public void setCheckInImplement(CheckInImplement checkInImplement) {
		this.checkInImplement = checkInImplement;
	}
	
	public Boolean getHaveMeeting() {
		return haveMeeting;
	}

	public void setHaveMeeting(Boolean haveMeeting) {
		this.haveMeeting = haveMeeting;
	}

	public Date getMeetingDate() {
		return meetingDate;
	}

	public void setMeetingDate(Date meetingDate) {
		this.meetingDate = meetingDate;
	}

	public String getMeetingRoom() {
		return meetingRoom;
	}

	public void setMeetingRoom(String meetingRoom) {
		this.meetingRoom = meetingRoom;
	}

	public Integer getPeoCount() {
		return peoCount;
	}

	public void setPeoCount(Integer peoCount) {
		this.peoCount = peoCount;
	}

	public String getMeetPlaceType() {
		return meetPlaceType;
	}

	public void setMeetPlaceType(String meetPlaceType) {
		this.meetPlaceType = meetPlaceType;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getContentLED() {
		return contentLED;
	}

	public void setContentLED(String contentLED) {
		this.contentLED = contentLED;
	}

	public String getLicense() {
		return license;
	}

	public void setLicense(String license) {
		this.license = license;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public CommonUser getOperator() {
		return operator;
	}

	public void setOperator(CommonUser operator) {
		this.operator = operator;
	}

	public Date getOperateDate() {
		return operateDate;
	}

	public void setOperateDate(Date operateDate) {
		this.operateDate = operateDate;
	}

	public CheckStatus getStatus() {
		return status;
	}

	public void setStatus(CheckStatus status) {
		this.status = status;
	}

	public String getScreenings() {
		return screenings;
	}

	public void setScreenings(String screenings) {
		this.screenings = screenings;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

}
